import Vue from 'vue';
import VueRouter from 'vue-router';
import Login from '../components/Login';
import Home from '../components/Home';
import Register from '../components/Register';
import Index from '../components/Index';
import Welcome from '../components/Welcome';
import UserList from "../components/use/UserList";
import ProblemList from "@/components/problem/ProblemList";
import AddProblem from "@/components/problem/AddProblem";

Vue.use(VueRouter)
  const routes = [
    {
      path:"/",
      redirect:"login"
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/register',
      component: Register
    },
    {
      path:'/home',
      component:Home,
      redirect: "/welcome",
      // 子组件
      children:[
          {path:"/welcome", component:Welcome},
        {path:"/teacher", component:UserList},
        {path:"/paper", component:ProblemList},
        {path:"/addpaper", component:AddProblem},
       ]
    },
    {
      path:'/index',
      component:Index
    }



]

const router = new VueRouter({
  routes
})

export default router
